<template>
    <div class="bgcx">
         <nav class="navbar navbar-expand-sm bg-dark navbar-dark fixed-top">
  <img class="navbar-brand" src="../img/logo2.jpg" id="a1">
  <ul class="navbar-nav">
    <li class="nav-item">
      <a class="nav-link" href="#">欢迎{{$store.state.Login.name}}登录</a>
    </li>
  </ul>
</nav>
    <div v-for="(item) in tme" :key="item.id">
         <span>{{item.tMember.name}}<br></span>
         <span>{{item.tMember.sex}}<br></span>
         <span>档案号：{{item.tMember.fileNumber}}<br></span>
         <span>体检日期：{{item.examDate | dateFormat}}<br></span>
         <span>上传时间：{{item.createtime | dateFormat}}<br></span>
         <span>体检套餐：{{item.setmeal.attention}}<br></span>
         <span><el-button @click="open(item.id)">体检报告</el-button><br></span>
  </div>

        <el-dialog title="体检报告" :visible.sync="dialogFormVisible">
       <el-table
        :data="tck"
         style="width: 100%">
       <el-table-column prop="tCheckitem.remark" width="180"></el-table-column>
       <el-table-column prop="jg" width="180"></el-table-column>
        </el-table> 
        </el-dialog>
    </div>
</template>



<script >
 import axios from 'axios' 
axios.defaults.baseURL="http://localhost:8085";
export default ({
        data(){
            return{
               com: this.$store.state.Login.id,
               tme:{},
               dialogFormVisible:false,
               tck:[]
            }
        },
        created(){
            axios.post("/seltme",{tMemberId:this.com}).then((response)=>{
                this.tme=response.data
			})
        },
        filters:{
            dateFormat:function(data){
                var dt=new Date(data)
                var n=dt.getFullYear();
                var y=(dt.getMonth()+1).toString().padStart(2,"0");
                var r=(dt.getDate()).toString().padStart(2,"0");
                dt.getHours();
                dt.getMinutes();
                dt.getSeconds();
                return n+"-"+y+"-"+r;
            }
        },
    methods: {
      open(row) {
          console.log(row)
         this.dialogFormVisible=true
         axios.post("/seltjbg",{tMemberExaminationId:row}).then((response)=>{
             this.tck=response.data
                console.log(response.data)
        })
      }
    }
})
</script>